package cn.marinda.resturants.service;

import cn.marinda.resturants.entity.Meal;
import cn.marinda.resturants.entity.Member;
import cn.marinda.resturants.global.Pages;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Qualifier;

import java.math.BigDecimal;
import java.util.List;

/** 会员服务层
 *
 * @date 2021/12/2
 * @author Marinda
 * @version 1.0
 */
@Qualifier
public interface MemberService extends IService<Member> {


    /**
     * 选择uid成员
     *
     * @param uid uid
     * @return {@link Member}
     */
    Member selectMemberUid(String uid);
    /** 会员列表
     *
     * @return 会员列表
     */
    List<Member> queryList();

    /** 添加会员
     *
     * @param member 会员
     *
     * @version 1.0
     * @data 2021/12/2
     */
    boolean addMember(Member member);

    /** 删除会员
     *
     * @param uid 会员
     * @return 结果
     */
    boolean deleteMember(Integer uid);

    /** 修改会员
     *
     * @param member 会员
     * @return  结果
     */
    boolean updateMember(Member member);


    /** 查询指定会员的折扣
     *
     * @param uid uid
     * @return 折扣
     */
    BigDecimal selectDiscount(Integer uid);

    /** 查询会员数量
     *
     * @param uid uid
     * @return 数量
     */
    Integer selectCount(Integer uid);

    /** 查询会员礼券数
     *
     * @param uid 会员uid
     * @return 礼券数
     */
    BigDecimal selectVochers(Integer uid);

    /** 查询会员名称
     *
     * @param uid uid
     * @return 会员名称
     */
    String selectName(Integer uid);

    /** 查询会员创建日期
     *
     * @param uid uid
     * @return 会员创建日期
     */

    String selectCreateDate(Integer uid);

    /** 分页
     *
     * @param pages 分页
     * @return 分页结果
     */
    IPage<Member> selectMemberPage(Pages<?> pages);

}
